home *** CD-ROM | disk | FTP | other *** search
- Path: redstone.interpath.net!mercury!softbase
- From: softbase@mercury.interpath.net (Scott McMahan - Softbase Systems)
- Newsgroups: comp.lang.c++
- Subject: Re: API's
- Date: 1 Mar 1996 17:40:06 GMT
- Organization: Interpath -- Providing Internet access to North Carolina
- Message-ID: <4h7cpm$ojd@news.interpath.net>
- References: <BMagnusson-2802961627410001@204.118.152.122>
- NNTP-Posting-Host: mercury.interpath.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Baiss E. Magnusson (BMagnusson@PrecisionImages.com) wrote:
-
- : Does anyone know why it is a good/bad idea to use a variable number of
- : parameters in C function calls which are part of an API?
-
- Good:
-
- 1. You're constrained by design decisions. I wrote a library
- that had to be interface-compatible with another library
- from the dim, dark past. Varargs were mandatory to keep
- the call format the same. No choice at all!
-
- Bad:
-
- 1. The design decisions were bad to begin with.
-
- 2. It's confusing to users of the library, because you
- call the same function different ways.
-
- The argument that you can't control what's being passed is a little
- bogus. You can't validate pointers passed in from a COBOL, C,
- Pascal, etc program to begin with. You have to accept what they
- pass you on blind faith whether it's a documented parameter
- or a varargs parameter.
-
- Scott
-
-
-
-
-